/**
 * 
 * Opened Touchable RIA Framework - A Web RIA Javascript Framework
 * 
 * Copyright (c) 2012
 * Dual licensed under the MIT or GPL v2 licenses.
 * 
 * @author  CuTe_CuBe
 * @version $Id: load.js 8 2012-03-11 14:16:41Z cc.hgfeng@gmail.com $
 */

/**
 * 提供动态加载js的方法
 * 
 */

/**
 * 加载指定外部js文件(s)
 * 
 * @param string | Array files
 * @param Function       callback
 * @param HTMLDocument   scope
 * @return void
 */
OTR.include = function(files, callback, scope){
    if (undefined === scope) {
        scope = document;
    }
    
    if (OTR.Util.isString(files)) {
        files = [files];
    }
    
    if (!OTR.Util.isArray(files)) {
        throws 'files must be an array or string of file url';
    }
    
    var count = files.length;
    for (var i = 0; i < count; i++) {
        var tag  = scope.createElement('script');
        tag.type = 'text/javascript';
        tag.src  = files;
    }
};

NTR.import = function(name, callback) {
    
};
